Data accessing method for flash memory storage device having data perturbation module, and storage system and controller using the same

ABSTRACT

A data accessing method, and a storage system and a controller using the same are provided. The data accessing method is suitable for a flash memory storage system having a data perturbation module. The data accessing method includes receiving a read command from a host and obtaining a logical block to be read and a page to be read from the read command. The data accessing method also includes determining whether a physical block in a data area corresponding to the logical block to be read is a new block and transmitting a predetermined data to the host when the physical block corresponding to the logical block to be read is a new block. Thereby, the host is prevented from reading garbled code from the flash memory storage system having the data perturbation module.

CROSS-REFERENCE TO RELATED APPLICATION

This is a continuation application of and claims priority benefit ofU.S. application Ser. No. 13/418,810, filed on Mar. 13, 2012, which is acontinuation application of and claims priority benefit of U.S.application Ser. No. 12/210,406, filed on Sep. 15, 2008, which claimsthe priority benefit of Taiwan patent application serial no. 97125974,filed on Jul. 9, 2008. The entirety of each of the above-mentionedpatent applications is hereby incorporated by reference herein and madea part of this specification.

BACKGROUND

1. Technology Field

The present invention generally relates to a data accessing method, andmore particularly, to a data accessing method which can prevent a hostfrom reading garbled codes, and a flash memory storage system and acontroller using the same.

2. Description of Related Art

Along with the widespread of digital cameras, camera phones, and MP3 inrecently years, the consumers' demand to storage media has increaseddrastically too. Flash memory is one of the most adaptable memories forsuch battery-powered portable products due to its characteristics suchas data non-volatility, low power consumption, small volume, andnon-mechanical structure. A memory card is a storage device which uses aNAND flash memory as its storage medium. Memory card has been broadlyadopted for storing personal data due to its small volume, large storagecapacity, and high portability. Thereby, flash memory has become one ofthe most focused electronic products in recent years.

Conventionally, the firmware executed by a controller of a flash memorystorage system is stored in a programmable read-only memory (PROM) ofthe controller, and the firmware is loaded into a static random accessmemory (SRAM) of the controller to be executed during the operation ofthe flash memory storage system. In order to reduce the size of thestorage device and update/modify the firmware conveniently, a techniquefor directly storing the firmware in a flash memory of a flash memorystorage system and loading the firmware into the controller only whenthe controller is about to work has been developed. According to thistechnique, a data perturbation module (or an encoding module) is usuallyimplemented and a data is encoded into a garbled code before it istransmitted to the flash memory. Besides, after the data is read fromthe flash memory, the data is decoded to restore the original data. Asdescribed above, the security of the firmware or other important datatransmitted between the controller and the flash memory is protected.

However, a card activation process has to be performed to a new flashmemory in a flash memory storage device when the flash memory storagedevice is just manufactured, wherein the card activation process is toinitialize each new block in the flash memory (i.e., setting the data ateach page address in each block to be 0xFF). In particular, thisinitialization action is not a write command and accordingly the data isnot encoded by the data perturbation module. However, when an end-usersystem issues a read command to a new block in the new flash memorystorage device, the data 0xFF stored in the new block is decoded by thedata perturbation module and accordingly the end-user system receives anunrecognizable garbled code. Accordingly, a data accessing method whichcan prevent a host from reading garbled code from a flash memory storagedevice having a data perturbation module is required.

SUMMARY

Accordingly, the present invention is directed to a data accessingmethod which can prevent a host from reading garbled codes from a flashmemory storage system having a data perturbation module.

The present invention is directed to a controller, wherein a memorymanagement module manages and reads new blocks of a flash memory throughforegoing data accessing method such that a host is prevented fromreading garbled codes from a flash memory storage system having a dataperturbation module.

The present invention is further directed to a storage system, wherein acontroller manages and reads new blocks of a flash memory throughforegoing data accessing method such that a host is prevented fromreading garbled codes from a flash memory storage system having a dataperturbation module.

The present invention provides a data accessing method suitable foraccessing a flash memory storage device having a data perturbationmodule, wherein a flash memory of the flash memory storage device has aplurality of physical blocks, and these physical blocks are grouped intoat least a data area and a spare area. The data accessing methodincludes receiving a read command from a host and obtaining a logicalblock to be read and a page to be read from the read command. The dataaccessing method also includes determining whether a physical block inthe data area corresponding to the logical block to be read is a newblock and transmitting a predetermined data to the host when thephysical block corresponding to the logical block to be read is a newblock.

According to an embodiment of the present invention, the predetermineddata is 0x00 or 0xFF.

According to an embodiment of the present invention, the data accessingmethod further includes recording an indicator for each physical blockto indicate that the physical block is a new block during a cardactivation process performed to the flash memory storage device. Thestep for determining whether a physical block in the data areacorresponding to the logical block to be read is a new block includesdetermining whether the physical block in the data area corresponding tothe logical block to be read is a new block according to the indicator.It is determined that the physical block corresponding to the logicalblock to be read is a new block if the physical block corresponding tothe logical block to be read has the indicator.

According to an embodiment of the present invention, the data accessingmethod further includes writing the predetermined data into apredetermined page of each physical block during the card activationprocess performed to the flash memory storage device, and the step fortransmitting the predetermined data to the host when the physical blockcorresponding to the logical block to be read is a new block includesreading data from the predetermined page of the physical blockcorresponding to the logical block to be read.

According to an embodiment of the present invention, the predeterminedpage is a first page of the physical block.

According to an embodiment of the present invention, the data accessingmethod further includes writing the predetermined data into all thepages of one of the physical blocks in the spare area during the cardactivation process performed to the flash memory storage device, and thestep for transmitting the predetermined data to the host when thephysical block corresponding to the logical block to be read is a newblock includes reading data from a page corresponding to the page to beread in the one of the physical blocks.

According to an embodiment of the present invention, the step fortransmitting the predetermined data to the host when the physical blockcorresponding to the logical block to be read is a new block includeschanging the data read from the physical block corresponding to thelogical block to be read into the predetermined data through hardware orfirmware.

According to an embodiment of the present invention, the data accessingmethod further includes decoding the data 0xFF in each physical block byusing the data perturbation module and recording the decoded data 0xFFinto a decode table during the card activation process performed to theflash memory storage device. The step for determining whether thephysical block in the data area corresponding to the logical block to beread is a new block includes comparing the data read from the physicalblock corresponding to the logical block to be read with the datarecorded in the decode table. It is determined that the physical blockcorresponding to the logical block to be read is a new block if the dataread from the physical block corresponding to the logical block to beread is the same as the data recorded in the decode table.

According to an embodiment of the present invention, the data accessingmethod further includes recording the indicator in a logical-physicalmapping table.

According to an embodiment of the present invention, the data accessingmethod further includes recording the indicator in a redundant area ofeach physical block.

The present invention provides a flash memory storage system including aflash memory, a connector, and a controller. The flash memory is usedfor storing data, wherein the flash memory includes a plurality ofphysical blocks, and these physical blocks are grouped into at least adata area and a spare area. The connector is used for connecting to ahost. The controller is electrically connected to the flash memory andthe connector, and the controller includes a microprocessor unit, a dataperturbation module, a flash memory interface, a buffer memory, and amemory management module. The microprocessor unit obtains a logicalblock to be read and a page to be read from a read command received froma host. The data perturbation module is electrically connected to themicroprocessor unit for decoding a data read from the flash memory. Theflash memory interface is electrically connected to the microprocessorunit for accessing the flash memory. The buffer memory is electricallyconnected to the microprocessor unit for temporarily storing data. Thememory management module is electrically connected to the microprocessorunit, and the memory management module determines whether a physicalblock in the data area corresponding to the logical block to be read isa new block and transmits a predetermined data to the host when thephysical block corresponding to the logical block to be read is a newblock.

According to an embodiment of the present invention, the predetermineddata is 0x00 or 0xFF.

According to an embodiment of the present invention, the memorymanagement module records an indicator for each physical block toindicate that the physical block is a new block during a card activationprocess performed to the flash memory storage device, and the memorymanagement module determines whether the physical block in the data areacorresponding to the logical block to be read is a new block accordingto the indicator.

According to an embodiment of the present invention, the memorymanagement module writes the predetermined data into a predeterminedpage of each physical block during the card activation process, and thememory management module reads data from the predetermined page of thephysical block corresponding to the logical block to be read when thephysical block corresponding to the logical block to be read is a newblock.

According to an embodiment of the present invention, the predeterminedpage is a first page of the physical block.

According to an embodiment of the present invention, the memorymanagement module writes the predetermined data into all the pages ofone of the physical blocks in the spare area during the card activationprocess, and the memory management module reads data from a pagecorresponding to the page to be read in the one of the physical blockswhen the physical block corresponding to the logical block to be read isa new block.

According to an embodiment of the present invention, the memorymanagement module changes the data read from the physical blockcorresponding to the logical block to be read into the predetermineddata when the physical block corresponding to the logical block to beread is a new block.

According to an embodiment of the present invention, the memorymanagement module decodes the data 0xFF in each physical block by usingthe data perturbation module and records the decoded data 0xFF into adecode table during the card activation process, and the memorymanagement module determines that the physical block corresponding tothe logical block to be read is a new block when the data read from thephysical block corresponding to the logical block to be read is the sameas the data recorded in the decode table.

According to an embodiment of the present invention, the memorymanagement module records the indicator in a logical-physical mappingtable.

According to an embodiment of the present invention, the memorymanagement module records the indicator in a redundant area of eachphysical block.

According to an embodiment of the present invention, the flash memorystorage device is a flash drive, a memory card, or a solid state drive(SSD).

In the present invention, whether a physical block is a new block isdetermined before a data is transmitted to a host, and a predetermineddata is transmitted to the host when the physical block is a new block.Thereby, the host is prevented from reading garbled code.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a furtherunderstanding of the invention, and are incorporated in and constitute apart of this specification. The drawings illustrate embodiments of theinvention and, together with the description, serve to explain theprinciples of the invention.

FIG. 1 is a schematic block diagram of a flash memory storage systemaccording to an embodiment of the present invention.

FIG. 2 is a detailed block diagram of a flash memory and operationsthereof according to an embodiment of the present invention.

FIG. 3A is a flowchart of a data accessing method according to a firstembodiment of the present invention.

FIG. 3B is a diagram illustrating how a host changes to read anotherpage according to the first embodiment of the present invention.

FIG. 4A is a flowchart of a data accessing method according to a secondembodiment of the present invention.

FIG. 4B illustrates an example of a logical-physical mapping tableaccording to the second embodiment of the present invention.

FIG. 4C is a diagram illustrating how a host changes to read anotherphysical block according to the second embodiment of the presentinvention.

FIG. 5 is a flowchart of a data accessing method according to a thirdembodiment of the present invention.

DESCRIPTION OF THE EMBODIMENTS

Reference will now be made in detail to the present preferredembodiments of the invention, examples of which are illustrated in theaccompanying drawings. Wherever possible, the same reference numbers areused in the drawings and the description to refer to the same or likeparts.

FIG. 1 is a schematic block diagram of a flash memory storage systemaccording to an embodiment of the present invention. Referring to FIG.1, the flash memory storage system 100 includes a controller 110, aconnector 120, and a flash memory 130.

The flash memory storage system 100 usually works together with a host200 to allow the host 200 to write data into or read data from the flashmemory storage system 100. In the present embodiment, the flash memorystorage system 100 is a solid state drive (SSD). However, in anotherembodiment of the present invention, the flash memory storage system 100may also be a memory card or a flash drive.

The controller 110 executes a plurality of commands implemented ashardware or firmware and coordinates with the connector 120 and theflash memory 130 to perform various data operations, such as datastoring, reading, and erasing, etc. The controller 110 includes amicroprocessor unit 110 a, a memory management module 110 b, a flashmemory interface 110 c, a buffer memory 110 d, and a data perturbationmodule 110 e.

The microprocessor unit 110 a coordinates with the memory managementmodule 110 b, the flash memory interface 110 c, the buffer memory 110 dand a data perturbation module 110 e to perform various operations ofthe flash memory storage system 100. For example, the microprocessorunit 110 a works together with the memory management module 110 b, theflash memory interface 110 c the buffer memory 110 d and a dataperturbation module 110 e to read and write data according to a readcommand or a write command it receives.

The memory management module 110 b is electrically connected to themicroprocessor unit 110 a. The memory management module 110 b managesthe flash memory 130. For example, the memory management module 110 bhas machine instructions for executing wear levelling, managing badblocks, and maintaining a mapping table, etc. In particular, the memorymanagement module 110 b executes a data accessing method as describedbelow with reference to several embodiments of the present invention.

It should be mentioned that in the present embodiment, the memorymanagement module 110 b is implemented as a hardware. However, inanother embodiment of the present invention, the memory managementmodule 110 b may also be implemented as a firmware. When the memorymanagement module 110 b is implemented as a firmware, the memorymanagement module 110 b has a plurality of machine instructions whichcan be executed by the microprocessor unit 110 a, and when the flashmemory storage system 100 is in operation, the memory management module110 b is loaded into the buffer memory 110 d to be executed by themicroprocessor unit 110 a.

The flash memory interface 110 c is electrically connected to themicroprocessor unit 110 a for accessing the flash memory 130. Namely,data to be written into the flash memory 130 by the host 200 isconverted by the flash memory interface 110 c into a format acceptableto the flash memory 130.

The buffer memory 110 d is electrically connected to the microprocessorunit 110 a for temporarily storing system data (such as alogical-physical mapping table) or data to be read or written by thehost 200. In the present embodiment, the buffer memory 110 d is a staticrandom access memory (SRAM). However, the present invention is notlimited thereto, and a dynamic random access memory (DRAM), amagnetoresistive random access memory (MRAM), a phase change randomaccess memory (PRAM), or other suitable memories may also be applied inthe present invention.

The data perturbation module 110 e is electrically connected to themicroprocessor unit 110 a for converting a sequence data into anon-sequence data or a non-sequence data into a sequence data. To bespecific, to ensure data security, in the present embodiment, all thedata transmitted when the controller 110 writes data into or read datafrom the flash memory 130 is encoded or decoded by the data perturbationmodule 110 e.

In an embodiment of the present invention, the data perturbation module110 e switches data of at least two bytes in a received data. Forexample, when the sequence data it receives is “01 02 03 04 05 06 07 0811 12 13 14 15 16 17 18”, the data perturbation module 110 e encodes thesequence data into “05 06 07 08 01 02 03 04 15 16 17 18 11 12 13 14”.Contrarily, when the non-sequence data it receives is “05 06 07 08 01 0203 04 15 16 17 18 11 12 13 14”, the data perturbation module 110 edecodes the non-sequence data into “01 02 03 04 05 06 07 08 11 12 13 1415 16 17 18”. However, foregoing example of data switching is notintended to restricting the scope of the present invention, and otherdata switching or re-arranging pattern can be easily implemented bythose skilled in the art according to the present disclosure.

In the present embodiment, the data perturbation module 110 e scramblesa data by changing the sequence of the data; however, in anotherembodiment of the present invention, the data perturbation module 110 emay also scramble a data by inverting each bit of the data (for example,change “0” into “1” or “1” into “0”) or by using an algorithm.

In addition, even though not shown in the present embodiment, thecontroller 110 may further include general function modules forcontrolling the flash memory, such as an error correction module and apower management module.

The connector 120 connects to the host 200 through a bus 300. In thepresent embodiment, the connector 120 is a PCI Express connector.However, the present invention is not limited thereto, and the connector120 may also be a USB connector, an IEEE 1394 connector, a SATAconnector, a MS connector, a MMC connector, a SD connector, a CFconnector, an IDE connector, or other suitable data transmissionconnectors.

The flash memory 130 is electrically connected to the controller 110 forstoring data. The flash memory 130 is substantially divided into aplurality of physical blocks 130-0˜130-N. Generally speaking, data in aflash memory is erased in unit of physical blocks. Namely, each physicalblock contains the smallest number of memory cells which are erasedtogether. Each physical block is usually divided into a plurality ofpages. Page is usually the smallest programming unit. However, it shouldbe noted that in some different flash memory designs, the smallestprogramming unit may also be sector, namely, a page has a plurality ofsectors and each sector is served as the smallest programming unit. Inother words, page is served as the smallest unit for reading and writingdata. A page is usually divided into a user data area D and a redundantarea R, wherein the user data area D is used for storing user data, andthe redundant area R is used for storing system data (for example, anerror correcting code (ECC)).

Generally speaking, the user data area D has 512 bytes and the redundantarea R has 16 bytes in order to correspond to the size of sectors in adisk drive. In other words, a page is a sector. However, a page may alsobe composed of a plurality of sectors. For example, a page may includefour sectors.

Generally speaking, a physical block can be composed of any number ofpages, such as 64 pages, 128 pages, and 256 pages, etc. The physicalblocks 130-0˜130-N are usually grouped into several zones. By managingthe operations of a memory based on zones, parallelism of the operationscan be increased and the management can be simplified.

The operation of the flash memory 130 will be described according to thepresent invention with reference to accompanying drawings. It should beunderstood that the terms “select”, “move”, and “substitute” used infollowing description only refer to logical operations performed to theflash memory 130. In other words, the physical positions of the blocksin the flash memory are not changed; instead, these blocks in the flashmemory 130 are only operated logically.

FIG. 2 is a detailed block diagram of the flash memory 130 and theoperations thereof according to an embodiment of the present invention.

Referring to FIG. 2, in the present embodiment, in order to program(i.e., write and erase) the flash memory 130 more efficiently, thephysical blocks 130-1˜130-N in the flash memory 130 are logicallygrouped into a system area 202, a data area 204, and a spare area 206.Generally speaking, more than 90% of the physical blocks in the flashmemory 130 belong to the data area 204.

Physical blocks in the system area 202 are used for recording systemdata, such as number of zones in the flash memory 130, number ofphysical blocks in each zone, number of pages in each physical block,and the logical-physical mapping table, etc.

Physical blocks in the data area 204 are used for storing user data, andthese physical blocks are actually the blocks corresponding to thelogical block addresses (LBA) operated by the host 200.

Physical blocks in the spare area 206 are used for substituting thephysical blocks in the data area 204. Thus, the physical blocks in thespare area 206 are blank or available blocks, namely, no data isrecorded in these blocks or data recorded in these blocks has beenmarked as invalid data. To be specific, an erasing operation has to beperformed before writing data to an address in which data has beenrecorded. However, as described above, data is written into a flashmemory in unit of pages while erased from the same in unit of blocks.Since the erase unit is larger than the write unit, valid pages in aphysical block have to be copied to another physical block before datain the physical block is erased. Accordingly, to write a new data into aphysical block M in the data area 204 which already contains a data, aphysical block S is first selected from the spare area 206, and thevalid data in the physical block M is copied to the physical block S andthe new data is also written into the physical block S. After that, thephysical block M is erased and moved to the spare area 206, and at thesame time, the physical block S is moved to the data area 204. It shouldbe understood that moving the physical block M to the spare area 206 andthe physical block S to the data area 204 is to link the physical blockM to the spare area 206 and the physical block S to the data area 204logically. It should be understood by those having ordinary knowledge inthe art that the logical relationship between blocks in the data area204 can be maintained through a logical-physical mapping table.

A card activation process is usually performed to the flash memorystorage system 100 right after the flash memory storage system 100 ismanufactured. During the card activation process, all the physicalblocks 130-0˜130-N of the flash memory 130 are initialized to set thedata therein to be 0xFF. As described above, the physical blocks130-0˜130-N of the flash memory 130 are grouped into the system area,the data area, and the spare area, wherein the physical blocks in thedata area are blocks containing valid data and to be accessed by thehost 200 (i.e., blocks corresponding to the logical blocks), and thephysical blocks in the spare area are used for substituting the blocksin the data area while executing write commands. Thus, the problem ofgetting garbled code just is occurred in the case of reading physicalblocks (i.e., new blocks) which are just initialized (i.e., data storedtherein is 0xFF). That is, when the physical blocks in the data area andthe physical blocks in the spare area once are written data with theabove-mentioned substituting operation, the problem of getting garbledcode is not occurred. According to the data accessing method provided bythe present invention, whether a physical block is a new block isdetermined before a data is transmitted to the host 200, and if thephysical block is a new block, a predetermined data (for example, 0x00or 0xFF) is transmitted to the host 200 so as to prevent the host 200from receiving garbled code. Embodiments of the present invention willbe described below with reference to accompanying drawings.

[First Embodiment]

As described above, a card activation process is performed to the flashmemory storage system 100 after the flash memory storage system 100 ismanufactured. Herein, the memory management module 110 b uses one bit ina redundant area R of a first page in each of the physical blocks forindicating that the physical block is a new block (i.e., no data hasbeen written therein). For example, the memory management module 110 brecords “1” in this bit for indicating that the physical block is a newblock and records “0” for indicating that the physical block is not anew block. Meanwhile, during the card activation process, the memorymanagement module 110 b writes data 0x00 into a data area D of the firstpage in each of the physical blocks. In particular, the data 0x00 isencoded by the data perturbation module 110 e and written as a garbledcode into the data area D of the first page in each physical block. Itshould be understood that herein the data 0x00 (i.e., the predetermineddata) is written into the first page of the physical block; however, thepresent invention is not limited thereto, and in another embodiment ofthe present invention, the predetermined data may also be written intoanother page of the physical block.

It should be mentioned that subsequently, when a data is written into aphysical block which is indicated as a new block during the operation ofthe flash memory storage system 100, the memory management module 110 bchanges the indicator of the physical block to indicate that thephysical block is not a new block. In particular, if the data is writteninto only some pages of the physical block which is indicated as a newblock, data 0x00 is written into the other pages to make sure that allthe pages in the physical block have been written.

In an embodiment of the present invention, when the host 200 desires toread data from the flash memory storage system 100, the memorymanagement module 110 b determines whether the physical blockcorresponding to the page the host 200 desires to read is a new block.If the page to be read is in a new block, the memory management module110 b reads the first page of the physical block and transmits the datatherein to the host 200. To be more specific, if the page to be read isin a new block, then the data stored in this page is 0xFF, and a garbledcode is produced when the data 0xFF is decoded by the data perturbationmodule 110 e, and accordingly the host 200 receives the unrecognizablegarbled code from this page. Thus, in the present embodiment, if thephysical block corresponding to the page to be read is a new block, thememory management module 110 b reads data from the first page of thephysical block and transmits the data to the host, wherein because thedata in the first page of the physical block is stored as the data 0x00encoded by the data perturbation module 110 e, data 0x00 is obtainedwhen the data read from the first page of the physical block is decodedby the data perturbation module 110 e. Accordingly, the host 200 isprevented from reading garbled code.

In the present embodiment, the indicator indicating whether a physicalblock is a new block is recorded in the redundant area R of the firstpage in the physical block. However, the present invention is notlimited thereto, and in another embodiment of the present invention, anindicator indicating whether a physical block corresponding to a logicalblock is a new block may also be recorded in a logical-physical mappingtable.

FIG. 3A is a flowchart of a data accessing method according to the firstembodiment of the present invention.

Referring to FIG. 3A, in step S301, the flash memory storage system 100receives a read command from the host 200, and the microprocessor unit110 a obtains a logical block to be read and a page thereof from theread command. Then, in step S303, the memory management module 110 breads the indicator from the first page of a physical blockcorresponding to the logical block to be read, and in step S305, thememory management module 110 b determines whether the physical blockcorresponding to the logical block to be read is a new block accordingto the indicator.

If it is determined in step S305 that the physical block correspondingto the logical block to be read is a new block, then in step S307, thememory management module 110 b reads data from the first page of thephysical block corresponding to the logical block to be read andtransmits the data to the host 200. For example, as shown in FIG. 3B,when the host 200 desires to read a page P1 of a logical block L0, thememory management module 110 b determines that the physical block 130-0corresponding to the logical block L0 is a new block according to theindicator “1” in the page P0 of the physical block 130-0. Thus, thememory management module 110 b reads data from the page P0 of thephysical block 130-0 instead of the page P1 of the physical block 130-0.

If it is determined in step S305 that the physical block correspondingto the logical block to be read is not a new block, then in step S309,the memory management module 110 b reads data from the physical blockand the page thereof corresponding to the logical block and the pagethereof obtained from the read command and transmits the data to thehost 200.

[Second Embodiment]

As described above, in the first embodiment, when it is determined thatthe physical block to be read is a new block, data 0x00 previouslywritten into the physical block is read by changing the page to be readin the physical block so as to prevent the host from reading garbledcode. However, this purpose may also be achieved by changing thephysical block to be read.

As described above, during the card activation process, all the physicalblocks of the flash memory 130 are initialized and data stored thereinare set to be 0xFF. Besides, according to the present embodiment, thememory management module 110 b indicates that the physical blockcorresponding to each logical block is a new block in thelogical-physical mapping table. For example, “1” is recorded in one bitof each record in the logical-physical mapping table for indicating thatthe physical block is a new block (as shown in FIG. 4B), and whensubsequently a data is written into the physical block which isindicated as a new block during the operation of the flash memorystorage system 100, the indicator is changed to “0” to indicate that thephysical block is not a new block. Meanwhile, in the present embodiment,the memory management module 110 b selects a physical block (forexample, the physical block 130-N in FIG. 4C) from the spare area 206 ofthe flash memory and writes data 0x00 into all the pages of the selectedphysical block. In particular, the data 0x00 is encoded by the dataperturbation module 110 e before it is written into all the pages of theselected physical block.

In the present embodiment, when the host 200 desires to read data fromthe flash memory storage system 100, the memory management module 110 bdetermines whether a physical block corresponding to the page to be readby the host 200 is a new block, and if the physical block correspondingto the page to be read is a new block, the memory management module 110b reads data from the corresponding page in the selected physical blockand transmits the data to the host 200. In the present embodiment, ifthe physical block corresponding to a page to be read is a new block,the memory management module 110 b reads data from a physical blockwhich is previously written with data 0x00 and transmits the data to thehost. Thereby, the host is prevented from reading garbled code.

FIG. 4A is a flowchart of a data accessing method according to thesecond embodiment of the present invention.

Referring to FIG. 4A, in step S401, the flash memory storage system 100receives a read command from the host 200, and the microprocessor unit110 a obtains a logical block to be read and a page thereof from theread command. Then, in step S403, the memory management module 110 breads an indicator of a physical block corresponding to the logicalblock to be read from the logical-physical mapping table, and in stepS405, the memory management module 110 b determines whether the physicalblock corresponding to the logical block to be read is a new blockaccording to the indicator.

If the memory management module 110 b determines that the physical blockcorresponding to the logical block to be read is a new block in stepS405, then in step S407, the memory management module 110 b reads datafrom the corresponding page in the selected physical block and transmitsthe data to the host. For example, as shown in FIG. 4C, when the host200 is about to read data from the page P1 of the logical block L0, thememory management module 110 b determines that the physical block 130-0is a new block according to the indicator “1” in the logical-physicalmapping table. Thus, the memory management module 110 b reads data fromthe page P1 of the physical block 130-N which is previously written withdata 0x00 instead of the page P1 of the physical block 130-0.

If the memory management module 110 b determines that the physical blockcorresponding to the logical block to be read is not a new block in stepS405, then in step S409, the memory management module 110 b reads datafrom the physical block and the page thereof corresponding to thelogical block to be read and the page thereof obtained from the readcommand and transmits the data to the host 200.

[Third Embodiment]

In the first embodiment and the second embodiment described above,whether a physical block to be read is a new block is determinedaccording to an indicator recorded in the redundant area of a first pagein the physical block or the logical-physical mapping table.Additionally, whether the physical block is a new block may also bedetermined according to the data read from the physical block.

In the present embodiment, during the card activation process of theflash memory storage system 100, the memory management module 110 bdecodes the data 0xFF in each initialized physical block by using thedata perturbation module 110 e and records the decoded data in a decodetable. When subsequently the controller 110 reads data from a physicalblock according to a read command received from the host 200, the memorymanagement module 110 b can determine whether the physical block is anew block by comparing the data read from the physical block and thedata recorded in the decode table.

In addition, in the first embodiment and the second embodiment describedabove, the previously written data 0x00 is read by respectively changingthe page and the physical block to be read so as to prevent the hostfrom reading the garbled code. However, in the present embodiment, thememory management module 110 b may respond to the read command bydirectly transmitting the data 0x00 to the host when it determines thatthe physical block corresponding to the logical block to be read is anew block, wherein the instruction for changing the data in the memorymanagement module 110 b may be implemented as a hardware or a firmware.

FIG. 5 is a flowchart of a data accessing method according to the thirdembodiment of the present invention.

Referring to FIG. 5, in step S501, the flash memory storage system 100receives a read command from the host 200, and the microprocessor unit110 a obtains a logical block to be read and a page thereof from theread command. Then, in step S503, the memory management module 110 breads data from a physical block and a page thereof corresponding to thelogical block to be read and the page thereof. Next, in step S505, thememory management module 110 b determines whether the data read from thephysical block is the same as the data in the decode table, wherein thememory management module 110 b determines that the physical blockcorresponding to the logical block to be read is a new block if the dataread from the physical block is the same as the data in the decodetable.

If the comparison in step S505 shows that the data read from thephysical block is the same as the data in the decode table, then in stepS507, the data read from the physical block is changed to 0x00, and thedata 0x00 is transmitted to the host 200.

If the comparison in step S505 shows that the data read from thephysical block is different from the data in the decode table, then instep S509, the data read from the physical block is transmitted to thehost 200.

In overview, according to the data accessing method provided by thepresent invention, whether a physical block is a new block is determinedbefore a data is transmitted to an end-user system, and if the physicalblock is a new block, data 0x00 is transmitted to the end-user system bychanging the page or physical block to be read or directly producing thedata 0x00. Thereby, the end-user system is prevented from readinggarbled codes from a new block in a flash memory storage system having adata perturbation module.

It will be apparent to those skilled in the art that variousmodifications and variations can be made to the structure of the presentinvention without departing from the scope or spirit of the invention.In view of the foregoing, it is intended that the present inventioncover modifications and variations of this invention provided they fallwithin the scope of the following claims and their equivalents.

What is claimed is:
 1. A data accessing method, for a flash memorystorage device having a data perturbation module, wherein a flash memoryof the flash memory storage device has a plurality of blocks, the dataaccessing method comprising: receiving a read command from a host,wherein the read command indicates reading data from a first block amongthe blocks; determining whether the first block is a new block;transmitting a predetermined data to the host if the first block is thenew block; and decoding data read from the first block by the dataperturbation module and transmitting the decoded data to the host if thefirst block is not the new block.
 2. The data accessing method accordingto claim 1, wherein the step of determining whether the first block isthe new block comprises: determining whether the first block is the newblock according to an indicator corresponding to the first block.
 3. Thedata accessing method according to claim 2, further comprising:recording indicators for the blocks to indicate that the blocks are thenew block during a card activation process performed to the flash memorystorage device.
 4. The data accessing method according to claim 3,wherein the indicators are recorded in a logical-physical mapping tableor redundant areas of the blocks.
 5. The data accessing method accordingto claim 1, wherein the predetermined data is different from an initialvalue stored in the blocks.
 6. The data accessing method according toclaim 1, further comprising writing the predetermined data into at leastone page of a second block of the blocks in the flash memory during acard activation process performed to the flash memory storage device,wherein the data accessing method further comprises: before transmittingthe predetermined data to the host if the first block is the new block,reading data from the second block and decoding the data read from thesecond block by the data perturbation module to obtain the predetermineddata.
 7. The data accessing method according to claim 1, wherein the newblock is a block not written with data from the host or a block being atan initial state due to a card activation process.
 8. A data accessingmethod, for a flash memory storage device having a data perturbationmodule, wherein a flash memory of the flash memory storage device has aplurality of physical blocks, the data accessing method comprising:receiving a read command from a host, wherein the read command indicatesreading data from a logical block; determining whether a physical blockcorresponding to the logical block to be read is a new block; andtransmitting a predetermined data to the host if the physical blockcorresponding to the logical block to be read is the new block, whereinthe predetermined data is obtained by decoding data stored in the flashmemory through the data perturbation module.
 9. The data accessingmethod according to claim 8, wherein the step of determining whether thephysical block corresponding to the logical block to be read is the newblock comprises: determining whether the physical block corresponding tothe logical block to be read is the new block according to an indicatorcorresponding to the physical block.
 10. The data accessing methodaccording to claim 9, further comprising: recording indicators for thephysical blocks to indicate that the physical blocks are the new blockduring a card activation process performed to the flash memory storagedevice.
 11. The data accessing method according to claim 10, wherein theindicators are recorded in a logical-physical mapping table or redundantareas of the physical blocks.
 12. The data accessing method according toclaim 8, wherein the predetermined data is different from an initialvalue stored in the physical blocks.
 13. The data accessing methodaccording to claim 8, further comprising writing the predetermined datainto at least one page of another physical block among the physicalblocks in the flash memory during a card activation process performed tothe flash memory storage device, wherein the data accessing methodfurther comprises: before transmitting the predetermined data to thehost if the physical block in the data area corresponding to the logicalblock to be read is the new block, reading data from the anotherphysical block and decoding the data read from the another physicalblock by the data perturbation module to obtain the predetermined data.14. The data accessing method according to claim 8, wherein the newblock is a block not written with data from the host or a block being atan initial state due to a card activation process.
 15. A controller, fora flash memory storage device having a flash memory, wherein the flashmemory has a plurality of blocks, the controller comprising: amicroprocessor unit, configured to receive a read command from a host,wherein the read command indicates reading data from a first block amongthe blocks; a data perturbation module, electrically connected to themicroprocessor unit for decoding data read from the flash memory; aflash memory interface, electrically connected to the microprocessorunit for accessing the flash memory; a buffer memory, electricallyconnected to the microprocessor unit for temporarily storing data; and amemory management module, electrically connected to the microprocessorunit and configured to determine whether the first block is a new block,wherein if the first block is the new block, the memory managementmodule transmits a predetermined data to the host.
 16. The controlleraccording to claim 15, wherein the memory management module determineswhether the first block is the new block according to an indicatorcorresponding to the first block.
 17. The controller according to claim16, wherein the memory management module recording indicators for theblocks to indicate that the blocks are the new block during a cardactivation process performed to the flash memory storage device.
 18. Thecontroller according to claim 17, wherein the indicators are recorded ina logical-physical mapping table or redundant areas of the blocks. 19.The controller according to claim 15, wherein the predetermined data isdifferent from an initial value stored in the blocks.
 20. The controlleraccording to claim 15, wherein the memory management module writes thepredetermined data into at least one page of a second block of theblocks in the flash memory during a card activation process performed tothe flash memory storage device, wherein before transmitting thepredetermined data to the host if the first block is the new block, thememory management module reads data from the second block and decodesthe data read from the second block by the data perturbation module toobtain the predetermined data.
 21. The controller according to claim 15,wherein the new block is a block not written with data from the host ora block being at an initial state due to a card activation process. 22.A controller, for a flash memory storage device having a dataperturbation module, wherein a flash memory of the flash memory storagedevice has a plurality of physical blocks, the controller comprising: amicroprocessor unit, configured to receive a read command from a host,wherein the read command indicates reading data from a logical block; adata perturbation module, electrically connected to the microprocessorunit for decoding data read from the flash memory; a flash memoryinterface, electrically connected to the microprocessor unit foraccessing the flash memory; a buffer memory, electrically connected tothe microprocessor unit for temporarily storing data; and a memorymanagement module, electrically connected to the microprocessor unit andconfigured to determine whether a physical block corresponding to thelogical block to be read is a new block, wherein if the physical blockcorresponding to the logical block to be read is the new block, thememory management module transmits a predetermined data to the host,wherein the predetermined data is obtained by decoding data stored inthe flash memory through the data perturbation module.
 23. Thecontroller according to claim 22, wherein the memory management moduledetermines whether the physical block corresponding to the logical blockto be read is the new block according to an indicator corresponding tothe physical block.
 24. The controller according to claim 23, whereinthe memory management module records indicators for the physical blocksto indicate that the physical blocks are the new block during a cardactivation process performed to the flash memory storage device.
 25. Thecontroller according to claim 24, wherein the indicators are recorded ina logical-physical mapping table or redundant areas of the physicalblocks.
 26. The controller according to claim 22, wherein thepredetermined data is different from an initial value stored in thephysical blocks.
 27. The controller according to claim 22, wherein thememory management module writes the predetermined data into at least onepage of another physical block among the physical blocks in the flashmemory during a card activation process performed to the flash memorystorage device, wherein before transmitting the predetermined data tothe host if the physical block corresponding to the logical block to beread is the new block, the memory management module reads data from theanother physical block and decodes the data read from the anotherphysical block by the data perturbation module to obtain thepredetermined data.
 28. The controller according to claim 22, whereinthe new block is a block not written with data from the host or a blockbeing at an initial state due to a card activation process.
 29. A flashmemory storage system, comprising: a flash memory configured to storedata, wherein the flash memory has a plurality of blocks; a connectorconfigured to connect to a host; and a controller electrically connectedto the flash memory and the connector, and configured to receive a readcommand from the host, wherein the read command indicates reading datafrom a first block among the blocks, wherein the controller determineswhether the first block is a new block, wherein if the first block isthe new block, the controller transmits a predetermined data to thehost, wherein the controller has a data perturbation module for decodingdata read from the flash memory.
 30. The flash memory storage systemaccording to claim 29, wherein the controller determines whether thefirst block is the new block according to an indicator corresponding tothe first block.
 31. The flash memory storage system according to claim30, wherein the controller recording indicators for the blocks toindicate that the blocks are the new block during a card activationprocess performed to the flash memory storage system.
 32. The flashmemory storage system according to claim 31, wherein the indicators arerecorded in a logical-physical mapping table or redundant areas of theblocks.
 33. The flash memory storage system according to claim 29,wherein the predetermined data is different from an initial value storedin the blocks.
 34. The flash memory storage system according to claim29, wherein the controller writes the predetermined data into at leastone page of a second block of the blocks in the flash memory during acard activation process performed to the flash memory storage system,wherein before transmitting the predetermined data to the host if thefirst block is the new block, the controller reads data from the secondblock and decodes the data read from the second block by the dataperturbation module to obtain the predetermined data.
 35. The flashmemory storage system according to claim 29, wherein the new block is ablock not written with data from the host or a block being at an initialstate due to a card activation process.
 36. A flash memory storagesystem, comprising: a flash memory configured to store data, wherein theflash memory has a plurality of physical blocks; a connector configuredto connect to a host; and a controller electrically connected to theflash memory and the connector, and configured to receive a read commandfrom the host, wherein the read command indicates reading data from alogical block, wherein the controller determines whether a physicalblock corresponding to the logical block to be read is a new block,wherein if the physical block corresponding to the logical block to beread is the new block, the controller transmits a predetermined data tothe host, wherein the predetermined data is obtained by decoding datastored in the flash memory through a data perturbation module of thecontroller.
 37. The flash memory storage system according to claim 36,wherein the controller determines whether the physical blockcorresponding to the logical block to be read is the new block accordingto an indicator corresponding to the physical block.
 38. The flashmemory storage system according to claim 37, wherein the controllerrecords indicators for the physical blocks to indicate that the physicalblocks are the new block during a card activation process performed tothe flash memory storage system.
 39. The flash memory storage systemaccording to claim 38, wherein the indicators are recorded in alogical-physical mapping table or redundant areas of the physicalblocks.
 40. The flash memory storage system according to claim 36,wherein the predetermined data is different from an initial value storedin the physical blocks.
 41. The flash memory storage system according toclaim 36, wherein the controller writes the predetermined data into atleast one page of another physical block among the physical blocks inthe flash memory during a card activation process performed to the flashmemory storage system, wherein before transmitting the predetermineddata to the host if the physical block corresponding to the logicalblock to be read is the new block, the controller reads data from theanother physical block and decodes the data read from the anotherphysical block by the data perturbation module to obtain thepredetermined data.
 42. The flash memory storage system according toclaim 36, wherein the new block is a block not written with data fromthe host or a block being at an initial state due to a card activationprocess.